#include "PO_MoM.h"
#include "Input.h"
#include "FillMatrix.h"
#include "SolveEquation.h"
#include "RadiationPattern.h"
#include <ctime>
#include <iostream>
#include <cmath>
using namespace std;

blitz::Array<Position3D,1> vNode, vWire, vPatchCtr, vPatchNorm, T;
blitz::Array<int,2> Edge, Patch;
blitz::Array<double,1> Edge_length;
blitz::Array<dComplex,1> V,I,J;
blitz::Array<dComplex,2> Z,Tau;
Position3D UnitVector;
int iWire,iNode, iPatch, iEdge;
double DeltaLength;
double WireRadius;
const double PI = 2*asin(1.0);
const double Epsilon = 8.854187817e-12;
const double Mu = PI*4e-7;
const double C = 1/sqrt(Epsilon*Mu);
const double Freq = C;
const double Omega = 2*PI*Freq;
const double WaveNumber = Omega/C;

int main()
{
	cout<<"Time Begin:"<<endl;
	clock_t start,finish;

	start = clock();
	Initial();
	finish = clock();
	cout <<"Time for Initialing: "<< double(finish-start)/CLOCKS_PER_SEC<<"s"<<endl;

	start = finish;
	FillZ();
	finish = clock();
	cout <<"Time for Filling Impedance Matrix: "<< double(finish-start)/CLOCKS_PER_SEC<<"s"<<endl;

	FillV();
	start = finish;
	GetI();
	GetJ();
	finish = clock();
	cout <<"Time for Solving Equation: "<< double(finish-start)/CLOCKS_PER_SEC<<"s"<<endl;

	start = finish;
	Output();
	finish = clock();
	cout <<"Time for Output: "<< double(finish-start)/CLOCKS_PER_SEC<<"s"<<endl;
	return 0;

}
